package com.lyz.jingjie;

import java.util.ArrayList;

/**
 * @ClassName GenericityTest
 * @Description 泛型类
 * @Author 2214361854
 * @Date 2022/2/21 17:10
 * @Version 1.0
 */
public class GenericityTest {
    public static void main(String[] args) {
        MyArrayList<String> list = new MyArrayList<>();
        list.add("java");
        list.add("java");
        System.out.println(list.toString());
    }

}
class MyArrayList<E>{
    private ArrayList list = new ArrayList();

    public void add(E e){
        list.add(e);
    }

    public MyArrayList() {
    }

    @Override
    public String toString() {
        return "MyArrayList{" +
                "list=" + list +
                '}';
    }
}
